package br.ufpb.di.ppgi.util.converter;

public class ConverterInteger implements Converter<String,Integer> {
	
	private static final ConverterInteger instance = new ConverterInteger();
	
	public static ConverterInteger getInstance() {
		return instance;
	}
	
	private ConverterInteger() {}

	@Override
	public Integer convert(String o) throws IllegalArgumentException {
		if (o == null)
			return null;

		try {
			return Integer.valueOf(o.trim());
		} catch (Exception ex) {
			return null;
		}
	}

}
